package com.hhkj.admin.student.mapper;

import java.util.List;

import com.hhkj.admin.student.model.dopo.StudentDo;
import com.hhkj.admin.student.model.dopo.StudentPo;
import com.hhkj.admin.train.domain.Train;
import com.hhkj.admin.train.model.dopo.TrainPo;
import com.ruoyi.common.base.biz.mapper.BaseMapper;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Mapper;
import com.hhkj.admin.student.domain.Student;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 学员信息Mapper接口
 *
 * @author ruoyi
 * @since 2023-05-12
 */
@Mapper
@Component
@CacheNamespace
public interface StudentMapper extends BaseMapper<Student, StudentDo, StudentPo> {

    /**
     * 查询学员信息列表（包含关联表信息）
     *
     * @param student 学员信息
     * @return 学员信息集合
     */
    List<Student> selectStudentRelevancyList(Student student);

    /**
     * 查询学员最近一次培训情况
     *
     * @param typeCode 做题类型 practise练习 test考试
     * @param student  传参
     * @return 最近一次培训情况
     */
    Train selectLastTrain(@Param("typeCode") String typeCode, @Param("student") Student student);

    /**
     * 查询给定学员id的培训情况
     *
     * @param typeCode   做题类型 practise练习 test考试
     * @param studentIds 学员id集合
     * @return 学员id的培训情况，降序
     */
    List<TrainPo> selectTrainByIdList(@Param("typeCode") String typeCode, @Param("studentIds") List<Long> studentIds);

    List<Student> listStudentPoByDo(@Param("studentDo") StudentDo studentDo);

}
